<%-- 
    Document   : phieumuahangcontent
    Created on : Nov 4, 2011, 11:52:11 AM
    Author     : Administrator
--%>

<%@page import="hibernate.pojo.Sanpham"%>
<%@page import="hibernate.pojo.Dondathang"%>
<%@page import="hibernate.pojo.Chitietdondathang"%>
<%@page import="java.util.List"%>
<%@page import="java.util.List"%>
<%@page import="hibernate.pojo.Khachhang"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
        try {
            //Khachhang khachHang = (Khachhang)session.getAttribute("KhachHang");
            String maKhachHang = request.getParameter("maKhachHang");
            List<Chitietdondathang> lstCtddh = (List<Chitietdondathang>)request.getAttribute("PhieuMuaHang");
    %> 
<div class="StaticMain">
    <ul id="tabHeader">
        <li class="Active"><a href="admincustomercontroller?action=viewlistdealbought&maKhachHang=<%=maKhachHang%>" title="Phiếu mua hàng"><span>Phiếu mua hàng</span></a></li>
        <li><a href="admincustomercontroller?action=viewlistdelivery&maKhachHang=<%=maKhachHang%>" title="Phiếu giao hàng"><span>Phiếu giao hàng</span></a></li>
        <li><a href="admincustomercontroller?action=viewlisttransactions&maKhachHang=<%=maKhachHang%>" title="Lịch sử giao dịch"><span>Lịch sử giao dịch</span></a></li>
    </ul>

    <div class="hastable">
        <table id="sort-table"> 
            <thead> 
                <tr>
                    <th><input type="checkbox" value="check_none" onclick="this.value=check(this.form.list)" class="submit"/></th>
                    <th>Mã phiếu</th>
                    <th>Ngày mua</th> 
                    <th>Deal</th>
                    <th>Số lượng</th> 
                    <th>Giá mua</th> 
                    
                    <th style="width:132px">Tùy Chỉnh</th> 
                </tr> 
            </thead> 
            <!-- donhang -->
                                        <%
                                        for(int i=0; i<lstCtddh.size();i++){
                                            Chitietdondathang ctddh = lstCtddh.get(i);
                                            Dondathang dondh = ctddh.getDondathang();
                                            Sanpham sanpham = ctddh.getSanpham();
                                            
                                        %>
            <tbody>
            <tr>
                    <td class="center"><input type="checkbox" value="1" name="list" class="checkbox"/></td> 
                    <td><%=ctddh.getMaChiTietDonDatHang()%></td> 
                    <td><%=dondh.getNgayDat()%></td> 
                    <td><%=sanpham.getTenSanPham()%></td> 
                    <td><%=ctddh.getSoLuongDat()%></td> 
                    <td><%=ctddh.getDonGiaBan()%></td>

                    <td>
                        <a class="btn_no_text btn ui-state-default ui-corner-all tooltip" title="Cập Nhật" href="admincustomercontroller?action=linktoupdate&amp;maKhachHang=">
                            <span class="ui-icon ui-icon-wrench"></span>
                        </a>
                        <a class="btn_no_text btn ui-state-default ui-corner-all tooltip" title="Favourite this example" href="admincustomercontroller?action=viewlistdealbought&amp;maKhachHang=1">
                            <span class="ui-icon ui-icon-heart"></span>
                        </a>
                        <a class="btn_no_text btn ui-state-default ui-corner-all tooltip" title="Add to shopping card example" href="#">
                            <span class="ui-icon ui-icon-cart"></span>
                        </a>
                        <a class="btn_no_text btn ui-state-default ui-corner-all tooltip" title="Delete this example" href="#">
                            <span class="ui-icon ui-icon-circle-close"></span>
                        </a>
                    </td>
                </tr>
            </tbody>
            <%}%>
        </table>
    </div>
</div>
 <%
        } catch (Exception ex) {
            System.err.print(ex);
        }
%>